const mongoose=require("mongoose");

mongoose.connect("mongodb://127.0.0.1:27017/design", { useNewUrlParser: true, useUnifiedTopology: true})
let db=mongoose.connection;
db.on("error",function(err){
    console.log(err);
    console.log("数据库连接出错");
})
db.on("open",function(){
    console.log("端口:1055");
    console.log("数据库连接成功");
})
module.exports={
    mongoose
}